<form action="index.php?option=com_mail_group" method="post" name="adminForm" id="adminForm">
	<fieldset id="filter-bar">
		<div class="filter-search fltlft">
			<label class="filter-search-lbl" for="filter_search" style="line-height: 20px;font-size: 13px;">フィルタ : </label>
			<input class="inputbox medium" type="text" name="keyword" id="keyword" value="<?php echo JRequest::getVar('keyword') ?>" title="Search title or alias. Prefix with ID: to search for an article ID.">

			<button type="submit" id="search" onclick="Joomla.submitbutton('search')" class="btn">検索</button>
			<!--<button type="button" id="clear" >クリア</button>-->
            <button type="button" class="button" onclick="
                                    document.id('keyword').value='';this.form.submit();">クリア</button>
		</div>
		
	</fieldset>
	<div class="clr"> </div>

	<table class="adminlist">
		<thead>
			<tr>
				<th width="5%">
                <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
                </th>
				<th class="left" style="width: 150px"><label class="labelth">グループID　</label></th>
				<th class="left"><label class="labelth">グループ名</label></th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="15">
				    <?php echo $this->pagination->getListFooter(); ?>	
                </td>
			</tr>
		</tfoot>
		<tbody id="result">	
        <?php
            $result = $this->result;
            //dump($result);
            if(!empty($result)){
                foreach ($result as $key=>$group){
                $row_cls = $key % 2;
                //$code = str_pad($group->MAGR_CODE,4,'0',STR_PAD_LEFT);
                echo "<tr class='row$row_cls'>
            			<td class='center'><input type='checkbox' id='cb0' name='cid[]' value='$group->MAGR_CODE' onclick='Joomla.isChecked(this.checked);'/></td>
            			<td class='left'><a href='index.php?option=com_mail_group&cid[]=$group->MAGR_CODE&task=edit'>$group->MAGR_CODE</a></td>
            			<td class='left'>$group->MAGR_NAME</td>
            		  </tr>";
                }
            }
        ?>	  
		</tbody>
        
	</table>

		

	<div>
		<input type="hidden" name="task" value="">
		<input type="hidden" name="boxchecked" value="0">
</form>
<script>
//    jq('#search').click(function(){
//        jq.ajax({
//          url: 'index.php?option=com_mail_group&task=ajax_seach_mg&tmpl=component'
//            +'&keyword='+jq('#keyword').val(),
//          context: document.body
//        }).done(function(data ) {
//          jq('#result').html(data);
//        });
//
//    });
    jq('#clear').click(function(event){
        jq('#keyword').val("");
    });

</script>


<script>
Joomla.submitbutton = function(task){
	   if(task == 'remove'){
	       if(!confirm('選択したデータを削除します。よろしいですか？')){
	           return false;
	       }
	   }
       
       Joomla.submitform(task, document.getElementById('adminForm'));
       
 }
</script>